home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr10 / recod324.zip / RECODE.DOC < prev   
Text File  |  1993-06-20  |  39KB  |  1,231 lines

  1. GNU Recode 3.2.4   Copyright 1993 FSF
  2.  
  3. Conversion of files between different charsets and usages
  4.  
  5.      This `recode' program has  the  purpose  of  converting
  6. files between various character sets and usages.  When exact
  7. transliterations are not possible, as it is often the  case,
  8. the  program may get rid of the offending characters or fall
  9. back on approximations.
  10.  
  11.      Let us coin the term charset to represent, without dis-
  12. tinction,  a  character set ``per se'' or a particular usage
  13. of a character set.  This program recognizes or  produces  a
  14. little  more  than  a  dozen of such charsets.  Since it can
  15. convert each charset to almost any other one, more than  one
  16. hundred different conversions are possible.
  17.  
  18.      This  tool pays special attention to superimposition of
  19. diacritics, particularily for French  representation.   This
  20. orientation  is  mostly  historical,  it does not impair the
  21. usefulness, generality or extensibility of the program.   In
  22. fact,  this  program evolved for several years, through sev-
  23. eral programming languages and computer  brands,  because  I
  24. used a lot of different coding for French characters on dif-
  25. ferent machines, each system having its own peculiarities.
  26.  
  27.      You may find in this document:
  28.  
  29.  
  30.  
  31.  
  32.  
  33. 1.1.  How to use this program
  34.  
  35.      The general format of the program call is:
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. 2                                    recode reference manual
  48.  
  49.  
  50.  
  51.     recode [OPTION]... [before]:[after] [file]...
  52.  
  53.  
  54.  
  55.      Each file file will be read assuming it is  coded  with
  56. charset before, it will be recoded over itself so to use the
  57. charset after.  If there is no such FILE, the program rather
  58. acts  as a filter and recode standard input to standard out-
  59. put.
  60.  
  61.      The available options are:
  62.  
  63.      -C   Given this option, all other  parameters  and  op-
  64.           tions are ignored.  The program prints briefly the
  65.           Copyright and copying conditions.   See  the  file
  66.           `COPYING'  in  the distribution for full statement
  67.           of the Copyright and copying conditions.
  68.  
  69.      -c   With Easy French conventions, use the column : in-
  70.           stead of the double-quote " for marking diaeresis.
  71.           See: See section Easy French.
  72.  
  73.      -f   This option is recognized, but otherwise  ignored.
  74.           Eventually,  this  option  will be necessary for a
  75.           file to be replaced by its recoded contents, if it
  76.           is  found  that  the  recoding  is  not  fully re-
  77.           versible.  In this version, the replacement is un-
  78.           conditionnaly done.
  79.  
  80.      -i   When the recoding requires a combination of two or
  81.           more elementary recoding steps, this option forces
  82.           many  passes  over  the  data,  using intermediate
  83.           files between passes.  This  is  the  default  be-
  84.           haviour  when  files  are recoded over themselves.
  85.           If this option is selected in  filter  mode,  that
  86.           is,  when  the  program  reads  standard input and
  87.           writes standard output, it might take  longer  for
  88.           programs  further down the pipe chain to start re-
  89.           ceiving some recoded data.
  90.  
  91.      -o   When the recoding requires a combination of two or
  92.           more elementary recoding steps, this option forces
  93.           the creation of a chain of program instances  ini-
  94.           tiated  through the popen(3) library call, all op-
  95.           erating in parallel.  In filter mode, at  cost  of
  96.           some overhead, recoded data will be available soon
  97.           after the program starts, even if many  elementary
  98.           recoding steps are required.
  99.  
  100.           If,  at  installation  time,  the popen(3) call is
  101.           said to be unavailable,  selecting  option  -o  is
  102.           equivalent to selecting option -i.
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113. recode reference manual                                    3
  114.  
  115.  
  116.      -p   When the recoding requires a combination of two or
  117.           more elementary recoding steps, this option forces
  118.           the  program  to fork itself into a few copies in-
  119.           terconnected with pipes, using the pipe(2)  system
  120.           call.  All copies of the program operate in paral-
  121.           lel.  This method is similar to  the  method  used
  122.           through option -o, but is slightly more efficient.
  123.           This is the default behaviour in filter mode.   If
  124.           this  option  is  used when files are recoded over
  125.           themselves, this should save  some  disk  accesses
  126.           and  some disk space, at cost of more system over-
  127.           head.
  128.  
  129.           If, at installation time, the pipe(2) call is said
  130.           to  be unavailable, selecting option -p is equiva-
  131.           lent to selecting option -o.  If both pipe(2)  and
  132.           popen(3)  are  unavailable, selecting option -p is
  133.           equivalent to selecting option -i.
  134.  
  135.      -t   The touch option is meaningful only when files are
  136.           recoded  over  themselves.  Without it, the times-
  137.           tamps associated with files are preserved, to  re-
  138.           flect  the  fact  that changing the code of a file
  139.           does not really alter its informational  contents.
  140.           When the user wants the recoded files to be times-
  141.           tamped at the recoding time; this option  inhibits
  142.           the automatic protection of the timestamps.
  143.  
  144.      -v   Before  proceeding,  the  program  will  print  on
  145.           `stderr' the list and order of application of ele-
  146.           mentary  conversions  which are planned to achieve
  147.           the global conversion.   Then,  the  program  will
  148.           print on `stderr' one message per file recoded, so
  149.           to let the user informed of the  progress  of  its
  150.           command.
  151.  
  152.      One  or  both  of  the  before or after keywords may be
  153. omitted, but the colon  which  separates  them  cannot.   An
  154. omitted  keyword  implies the usual or default code in usage
  155. on the system where this  program  is  installed.   Usually,
  156. this  default  code  is latin1 for UNIX systems or ibmpc for
  157. MS-DOS machines, but it might be changed to any  other  sup-
  158. ported code when this program is installed.
  159.  
  160. 1.2.  Character sets recognized of produced
  161.  
  162.      The possible values for charset before or charset after
  163. are provided as the keys in the following menu.
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. 4                                    recode reference manual
  180.  
  181.  
  182. 1.2.1.  ASCII 8-bits for Apple's Macintosh
  183.  
  184.      The file has been obtained or is aimed to  a  Macintosh
  185. micro-computer  from Apple.  This is an eight bit code.  The
  186. file is the data fork only.
  187.  
  188. 1.2.2.  ASCII 7-bits, BS to overstrike
  189.  
  190.      The file is straight ASCII, seven bits only.  According
  191. to  the  definition  of  ASCII:  diacritics are applied by a
  192. sequence of three characters: the letter, one BS,  the  dia-
  193. critic  mark.   We  deviate slightly from this by exchanging
  194. the diacritic mark and the letter so, on  a  screen  device,
  195. the  diacritic  will disappear and let the letter alone.  At
  196. recognition time, both methods are acceptable.
  197.  
  198.      The French quotes are coded by the sequences: < BS " or
  199. "  BS  <  for the opening quote and > BS " or " BS > for the
  200. closing quote.  This artifical convention was  inherited  in
  201. straight ascii from habits around bangbang entry, and is not
  202. well known.  But we decided to stick to  it  so  that  ascii
  203. charset will not loose French quotes.
  204.  
  205. 1.2.2.1.  Commented ASCII
  206.  
  207.  
  208.     oct dec hex     name    description
  209.  
  210.     000   0  0      nul     null character
  211.     001   1  1      soh     start of header
  212.     002   2  2      stx     start of text
  213.     003   3  3      etx     end of text
  214.     004   4  4      eot     end of transmission
  215.     005   5  5      enq     enquiry
  216.     006   6  6      ack     acknowledge
  217.     007   7  7      bel     bell
  218.     010   8  8      bs      back space
  219.     011   9  9      ht      horizontal tab
  220.     012  10  a      nl      new line
  221.     013  11  b      vt      vertical tab
  222.     014  12  c      np      new page
  223.     015  13  d      cr      carriage return
  224.     016  14  e      so      shift out
  225.     017  15  f      si      shift in
  226.     020  16 10      dle     data link escape
  227.     021  17 11      dc1     device control 1
  228.     022  18 12      dc2     device control 2
  229.     023  19 13      dc3     device control 3
  230.     024  20 14      dc4     device control 4
  231.     025  21 15      nak     negative acknowledge
  232.     026  22 16      syn     synchronize
  233.     027  23 17      etb     end of transmitted block
  234.     030  24 18      can     cancel
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245. recode reference manual                                    5
  246.  
  247.  
  248.     031  25 19      em      end of medium
  249.     032  26 1a      sub     substitute
  250.     033  27 1b      esc     escape
  251.     034  28 1c      fs      file separator
  252.     035  29 1d      gs      group separator
  253.     036  30 1e      rs      record separator
  254.     037  31 1f      us      unit separator
  255.     040  32 20      sp      space
  256.  
  257.     177 127 7f      del     delete
  258.  
  259.  
  260.  
  261. 1.2.2.2.  Octal ASCII
  262.  
  263.  
  264.     000 nul  020 dle  040 sp 060 0  100 @  120 P  140 `  160 p
  265.     001 soh  021 dc1  041 !  061 1  101 A  121 Q  141 a  161 q
  266.     002 stx  022 dc2  042 "  062 2  102 B  122 R  142 b  162 r
  267.     003 etx  023 dc3  043 #  063 3  103 C  123 S  143 c  163 s
  268.     004 eot  024 dc4  044 $  064 4  104 D  124 T  144 d  164 t
  269.     005 enq  025 nak  045 %  065 5  105 E  125 U  145 e  165 u
  270.     006 ack  026 syn  046 &  066 6  106 F  126 V  146 f  166 v
  271.     007 bel  027 etb  047 '  067 7  107 G  127 W  147 g  167 w
  272.     010 bs   030 can  050 (  070 8  110 H  130 X  150 h  170 x
  273.     011 ht   031 em   051 )  071 9  111 I  131 Y  151 i  171 y
  274.     012 nl   032 sub  052 *  072 :  112 J  132 Z  152 j  172 z
  275.     013 vt   033 esc  053 +  073 ;  113 K  133 [  153 k  173 {
  276.     014 np   034 fs   054 ,  074 <  114 L  134 \  154 l  174 |
  277.     015 cr   035 gs   055 -  075 =  115 M  135 ]  155 m  175 }
  278.     016 so   036 rs   056 .  076 >  116 N  136 ^  156 n  176 ~
  279.     017 si   037 us   057 /  077 ?  117 O  137 _  157 o  177 del
  280.  
  281.  
  282.  
  283. 1.2.2.3.  Decimal ASCII
  284.  
  285.  
  286.       0 nul  16 dle  32 sp 48 0  64 @  80 P   96 `  112 p
  287.       1 soh  17 dc1  33 !  49 1  65 A  81 Q   97 a  113 q
  288.       2 stx  18 dc2  34 "  50 2  66 B  82 R   98 b  114 r
  289.       3 etx  19 dc3  35 #  51 3  67 C  83 S   99 c  115 s
  290.       4 eot  20 dc4  36 $  52 4  68 D  84 T  100 d  116 t
  291.       5 enq  21 nak  37 %  53 5  69 E  85 U  101 e  117 u
  292.       6 ack  22 syn  38 &  54 6  70 F  86 V  102 f  118 v
  293.       7 bel  23 etb  39 '  55 7  71 G  87 W  103 g  119 w
  294.       8 bs   24 can  40 (  56 8  72 H  88 X  104 h  120 x
  295.       9 ht   25 em   41 )  57 9  73 I  89 Y  105 i  121 y
  296.      10 nl   26 sub  42 *  58 :  74 J  90 Z  106 j  122 z
  297.      11 vt   27 esc  43 +  59 ;  75 K  91 [  107 k  123 {
  298.      12 np   28 fs   44 ,  60 <  76 L  92 \  108 l  124 |
  299.      13 cr   29 gs   45 -  61 =  77 M  93 ]  109 m  125 }
  300.      14 so   30 rs   46 .  62 >  78 N  94 ^  110 n  126 ~
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311. 6                                    recode reference manual
  312.  
  313.  
  314.      15 si   31 us   47 /  63 ?  79 O  95 _  111 o  127 del
  315.  
  316.  
  317.  
  318. 1.2.2.4.  Hexadecimal ASCII
  319.  
  320.  
  321.      00 nul  10 dle  20 sp 30 0  40 @  50 P  60 `  70 p
  322.      01 soh  11 dc1  21 !  31 1  41 A  51 Q  61 a  71 q
  323.      02 stx  12 dc2  22 "  32 2  42 B  52 R  62 b  72 r
  324.      03 etx  13 dc3  23 #  33 3  43 C  53 S  63 c  73 s
  325.      04 eot  14 dc4  24 $  34 4  44 D  54 T  64 d  74 t
  326.      05 enq  15 nak  25 %  35 5  45 E  55 U  65 e  75 u
  327.      06 ack  16 syn  26 &  36 6  46 F  56 V  66 f  76 v
  328.      07 bel  17 etb  27 '  37 7  47 G  57 W  67 g  77 w
  329.      08 bs   18 can  28 (  38 8  48 H  58 X  68 h  78 x
  330.      09 ht   19 em   29 )  39 9  49 I  59 Y  69 i  79 y
  331.      0a nl   1a sub  2a *  3a :  4a J  5a Z  6a j  7a z
  332.      0b vt   1b esc  2b +  3b ;  4b K  5b [  6b k  7b {
  333.      0c np   1c fs   2c ,  3c <  4c L  5c \  6c l  7c |
  334.      0d cr   1d gs   2d -  3d =  4d M  5d ]  6d m  7d }
  335.      0e so   1e rs   2e .  3e >  4e N  5e ^  6e n  7e ~
  336.      0f si   1f us   2f /  3f ?  4f O  5f _  6f o  7f del
  337.  
  338.  
  339.  
  340. 1.2.3.  ASCII ``bang bang'', escapes are ! and !!
  341.  
  342.      This  is  the local code in use on Cybers at Universite
  343. de Montreal, which grave and serious people there prefer  to
  344. name  ASCII  code display.  This code is also known as Bang-
  345. bang.  It is based on a six bits character set in which cap-
  346. itals, French diacritics and a few others are coded using an
  347. ! escape followed by a single character, and control charac-
  348. ters using a double ! escape followed by a single character.
  349.  
  350.      The routines given here presume that the six bits  code
  351. is  already expressed in ASCII by the communication channel,
  352. with embedded ASCII !  escapes.
  353.  
  354.      Here is a table showing which characters are being used
  355. to encode each ASCII character.
  356.  
  357.  
  358.     000 !!@  020 !!P  040    060 0  100 @   120 !P  140 !@ 160 P
  359.     001 !!A  021 !!Q  041 !" 061 1  101 !A  121 !Q  141 A  161 Q
  360.     002 !!B  022 !!R  042 "  062 2  102 !B  122 !R  142 B  162 R
  361.     003 !!C  023 !!S  043 #  063 3  103 !C  123 !S  143 C  163 S
  362.     004 !!D  024 !!T  044 $  064 4  104 !D  124 !T  144 D  164 T
  363.     005 !!E  025 !!U  045 %  065 5  105 !E  125 !U  145 E  165 U
  364.     006 !!F  026 !!V  046 &  066 6  106 !F  126 !V  146 F  166 V
  365.     007 !!G  027 !!W  047 '  067 7  107 !G  127 !W  147 G  167 W
  366.     010 !!H  030 !!X  050 (  070 8  110 !H  130 !X  150 H  170 X
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377. recode reference manual                                    7
  378.  
  379.  
  380.     011 !!I  031 !!Y  051 )  071 9  111 !I  131 !Y  151 I  171 Y
  381.     012 !!J  032 !!Z  052 *  072 :  112 !J  132 !Z  152 J  172 Z
  382.     013 !!K  033 !![  053 +  073 ;  113 !K  133 [   153 K  173 ![
  383.     014 !!L  034 !!\  054 ,  074 <  114 !L  134 \   154 L  174 !\
  384.     015 !!M  035 !!]  055 -  075 =  115 !M  135 ]   155 M  175 !]
  385.     016 !!N  036 !!^  056 .  076 >  116 !N  136 ^   156 N  176 !^
  386.     017 !!O  037 !!_  057 /  077 ?  117 !O  137 _   157 O  177 !_
  387.  
  388.  
  389.  
  390. 1.2.3.1.  Control Data's Display Code
  391.  
  392.  
  393.     Octal display code to graphic       Octal display code to octal ASCII
  394.  
  395.     00  :    20  P    40  5   60  #     00 072  20 120  40 065  60 043
  396.     01  A    21  Q    41  6   61  [     01 101  21 121  41 066  61 133
  397.     02  B    22  R    42  7   62  ]     02 102  22 122  42 067  62 135
  398.     03  C    23  S    43  8   63  %     03 103  23 123  43 070  63 045
  399.     04  D    24  T    44  9   64  "     04 104  24 124  44 071  64 042
  400.     05  E    25  U    45  +   65  _     05 105  25 125  45 053  65 137
  401.     06  F    26  V    46  -   66  !     06 106  26 126  46 055  66 041
  402.     07  G    27  W    47  *   67  &     07 107  27 127  47 052  67 046
  403.     10  H    30  X    50  /   70  '     10 110  30 130  50 057  70 047
  404.     11  I    31  Y    51  (   71  ?     11 111  31 131  51 050  71 077
  405.     12  J    32  Z    52  )   72  <     12 112  32 132  52 051  72 074
  406.     13  K    33  0    53  $   73  >     13 113  33 060  53 044  73 076
  407.     14  L    34  1    54  =   74  @     14 114  34 061  54 075  74 100
  408.     15  M    35  2    55      75  \     15 115  35 062  55 040  75 134
  409.     16  N    36  3    56  ,   76  ^     16 116  36 063  56 054  76 136
  410.     17  O    37  4    57  .   77  ;     17 117  37 064  57 056  77 073
  411.  
  412.  
  413.  
  414. 1.2.4.  ASCII 8-bits as seen by Perkin Elmer
  415.  
  416.      This  charset  represents  the  way Concurrent Computer
  417. Corporation (formerly Perkin Elmer) expresses  EBCDIC  using
  418. ASCII.
  419.  
  420. 1.2.5.  ASCII 8-bits a seen by Control Data
  421.  
  422.      This  charset  represents the way Control Data Corpora-
  423. tion relates EBCDIC to ASCII.  We also select the lower half
  424. of  this  table  to do straigth ASCII to EBCDIC conversions,
  425. back and forth.
  426.  
  427. 1.2.6.  ASCII 6/12 from NOS, escapes are ^ and @
  428.  
  429.      This is one of the charset in use on CDC Cyber NOS sys-
  430. tems  to  represent ASCII, sometimes named NOS 6/12 code for
  431. coding ASCII.  This code is also known as caret  ASCII.   It
  432. is  based on a six bits character set in which small letters
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443. 8                                    recode reference manual
  444.  
  445.  
  446. and control characters are coded using a ^ escape and, some-
  447. times, a @ escape.
  448.  
  449.      The  routines given here presume that the six bits code
  450. is already expressed in ASCII by the communication  channel,
  451. with embedded ASCII ^ and @ escapes.
  452.  
  453.      Here is a table showing which characters are being used
  454. to encode each ASCII character.
  455.  
  456.  
  457.     000  ^5  020  ^#  040     060  0  100 @A  120  P  140  @G  160  ^P
  458.     001  ^6  021  ^[  041  !  061  1  101  A  121  Q  141  ^A  161  ^Q
  459.     002  ^7  022  ^]  042  "  062  2  102  B  122  R  142  ^B  162  ^R
  460.     003  ^8  023  ^%  043  #  063  3  103  C  123  S  143  ^C  163  ^S
  461.     004  ^9  024  ^"  044  $  064  4  104  D  124  T  144  ^D  164  ^T
  462.     005  ^+  025  ^_  045  %  065  5  105  E  125  U  145  ^E  165  ^U
  463.     006  ^-  026  ^!  046  &  066  6  106  F  126  V  146  ^F  166  ^V
  464.     007  ^*  027  ^&  047  '  067  7  107  G  127  W  147  ^G  167  ^W
  465.     010  ^/  030  ^'  050  (  070  8  110  H  130  X  150  ^H  170  ^X
  466.     011  ^(  031  ^?  051  )  071  9  111  I  131  Y  151  ^I  171  ^Y
  467.     012  ^)  032  ^<  052  *  072 @D  112  J  132  Z  152  ^J  172  ^Z
  468.     013  ^$  033  ^>  053  +  073  ;  113  K  133  [  153  ^K  173  ^0
  469.     014  ^=  034  ^@  054  ,  074  <  114  L  134  \  154  ^L  174  ^1
  470.     015  ^   035  ^\  055  -  075  =  115  M  135  ]  155  ^M  175  ^2
  471.     016  ^,  036  ^^  056  .  076  >  116  N  136 @B  156  ^N  176  ^3
  472.     017  ^.  037  ^;  057  /  077  ?  117  O  137  _  157  ^O  177  ^4
  473.  
  474.  
  475.  
  476. 1.2.7.  EBCDIC with no further comments
  477.  
  478.      This charset is the IBM's external binary coded decimal
  479. for interchange coding.  This is an eight bits code.
  480.  
  481. 1.2.8.  ASCII without diacritics nor underline
  482.  
  483.      This  code  is  ASCII  expunged  of  all diacritics and
  484. underlines, as long as they are applied using three  charac-
  485. ter  sequences,  with  BS  in  the  middle.   Also,  despite
  486. slightly unrelated, each control character is represented by
  487. a  sequence of two or three graphic characters.  The newline
  488. character, however, keeps its functionnality and is not rep-
  489. resented.
  490.  
  491.      Note  that  charset flat is a terminal charset.  We can
  492. convert to flat, but not from it.
  493.  
  494. 1.2.9.  ASCII 8-bits for IBM's PC
  495.  
  496.      The file was obtained or is aimed towards a  PC  micro-
  497. computer  from  IBM or any compatible.  This is an eight-bit
  498. code.
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509. recode reference manual                                    9
  510.  
  511.  
  512. 1.2.10.  ASCII for the Unisys' ICON
  513.  
  514.      The file is using Unisys' ICON way  to  represent  dia-
  515. critics  with  0x19  escape  sequences.  This is a seven-bit
  516. code, even if eight-bit codes can flow through  as  part  of
  517. IBM-PC charset.
  518.  
  519. 1.2.11.  ASCII with LaTeX codes
  520.  
  521.      This charset is an ASCII file coded to be read by LaTeX
  522. or, in certain cases, by TeX.
  523.  
  524. 1.2.12.  ASCII extended by Latin Alphabet 1
  525.  
  526.      This charset corresponds to the ISO Latin  Alphabet  1.
  527. It  is  an eight-bit code which coincides with ASCII for the
  528. lower half.
  529.  
  530. 1.2.12.1.  Commented Latin-1
  531.  
  532.  
  533.     oct dec hex     description
  534.  
  535.     240 160 a0      no-break space
  536.     241 161 a1      inverted exclamation mark
  537.     242 162 a2      cent sign
  538.     243 163 a3      pound sign
  539.     244 164 a4      currency sign
  540.     245 165 a5      yen sign
  541.     246 166 a6      broken bar
  542.     247 167 a7      paragraph sign, section sign
  543.     250 168 a8      diaeresis
  544.     251 169 a9      copyright sign
  545.     252 170 aa      feminine ordinal indicator
  546.     253 171 ab      left angle quotation mark
  547.     254 172 ac      not sign
  548.     255 173 ad      soft hyphen
  549.     256 174 ae      registered trade mark sign
  550.     257 175 af      macron
  551.     260 176 b0      degree sign
  552.     261 177 b1      plus-minus sign
  553.     262 178 b2      superscript two
  554.     263 179 b3      superscript three
  555.     264 180 b4      acute accent
  556.     265 181 b5      small greek mu, micro sign
  557.     266 182 b6      pilcrow sign
  558.     267 183 b7      middle dot
  559.     270 184 b8      cedilla
  560.     271 185 b9      superscript one
  561.     272 186 ba      masculine ordinal indicator
  562.     273 187 bb      right angle quotation mark
  563.     274 188 bc      vulgar fraction one quarter
  564.     275 189 bd      vulgar fraction one half
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575. 10                                   recode reference manual
  576.  
  577.  
  578.     276 190 be      vulgar fraction three quarters
  579.     277 191 bf      inverted question mark
  580.     300 192 c0      capital A with grave accent
  581.     301 193 c1      capital A with acute accent
  582.     302 194 c2      capital A with circumflex accent
  583.     303 195 c3      capital A with tilde
  584.     304 196 c4      capital A diaeresis
  585.     305 197 c5      capital A with ring above
  586.     306 198 c6      capital diphthong A with E
  587.     307 199 c7      capital C with cedilla
  588.     310 200 c8      capital E with grave accent
  589.     311 201 c9      capital E with acute accent
  590.     312 202 ca      capital E with circumflex accent
  591.     313 203 cb      capital E with diaeresis
  592.     314 204 cc      capital I with grave accent
  593.     315 205 cd      capital I with acute accent
  594.     316 206 ce      capital I with circumflex accent
  595.     317 207 cf      capital I with diaeresis
  596.     320 208 d0      capital icelandic ETH
  597.     321 209 d1      capital N with tilde
  598.     322 210 d2      capital O with grave accent
  599.     323 211 d3      capital O with acute accent
  600.     324 212 d4      capital O with circumflex accent
  601.     325 213 d5      capital O with tilde
  602.     326 214 d6      capital O with diaeresis
  603.     327 215 d7      multiplication sign
  604.     330 216 d8      capital O with oblique stroke
  605.     331 217 d9      capital U with grave accent
  606.     332 218 da      capital U with acute accent
  607.     333 219 db      capital U with circumflex accent
  608.     334 220 dc      capital U with diaeresis
  609.     335 221 dd      capital Y with acute accent
  610.     336 222 de      capital icelandic THORN
  611.     337 223 df      small german sharp s
  612.     340 224 e0      small a with grave accent
  613.     341 225 e1      small a with acute accent
  614.     342 226 e2      small a with circumflex accent
  615.     343 227 e3      small a with tilde
  616.     344 228 e4      small a with diaeresis
  617.     345 229 e5      small a with ring above
  618.     346 230 e6      small diphthong a with e
  619.     347 231 e7      small c with cedilla
  620.     350 232 e8      small e with grave accent
  621.     351 233 e9      small e with acute accent
  622.     352 234 ea      small e with circumflex accent
  623.     353 235 eb      small e with diaeresis
  624.     354 236 ec      small i with grave accent
  625.     355 237 ed      small i with acute accent
  626.     356 238 ee      small i with circumflex accent
  627.     357 239 ef      small i with diaeresis
  628.     360 240 f0      small icelandic eth
  629.     361 241 f1      small n with tilde
  630.     362 242 f2      small o with grave accent
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641. recode reference manual                                   11
  642.  
  643.  
  644.     363 243 f3      small o with acute accent
  645.     364 244 f4      small o with circumflex accent
  646.     365 245 f5      small o with tilde
  647.     366 246 f6      small o with diaeresis
  648.     367 247 f7      division sign
  649.     370 248 f8      small o with oblique stroke
  650.     371 249 f9      small u with grave accent
  651.     372 250 fa      small u with acute accent
  652.     373 251 fb      small u with circumflex accent
  653.     374 252 fc      small u with diaeresis
  654.     375 253 fd      small y with acute accent
  655.     376 254 fe      small icelandic thorn
  656.     377 255 ff      small y with diaeresis
  657.  
  658.  
  659.  
  660. 1.2.12.2.  Octal Latin-1
  661.  
  662.  
  663.     200    220    240 nsp 260 ++  300 A`  320 DD  340 a`  360 dd
  664.     201    221    241 !!  261 +-  301 A'  321 N~  341 a'  361 n~
  665.     202    222    242 c|  262 22  302 A^  322 O`  342 a^  362 o`
  666.     203    223    243 ##  263 33  303 A~  323 O'  343 a~  363 o'
  667.     204    224    244 cur 264   304 A"  324 O^  344 a"  364 o^
  668.     205    225    245 y-  265 uu  305 A+  325 O~  345 a+  365 o~
  669.     206    226    246 ||  266 pil 306 AE  326 O"  346 ae  366 o"
  670.     207    227    247 $$  267 ..  307 C,  327 xx  347 c,  367 //
  671.     210    230    250 ""  270 ,,  310 E`  330 O/  350 e`  370 o/
  672.     211    231    251 cO  271 11  311 E'  331 U`  351 e'  371 u`
  673.     212    232    252 a-  272 o-  312 E^  332 U'  352 e^  372 u'
  674.     213    233    253 <<  273 >>  313 E"  333 U^  353 e"  373 u^
  675.     214    234    254 -.  274 14  314 I`  334 U"  354 i`  374 u"
  676.     215    235    255 --  275 12  315 I'  335 Y'  355 i'  375 y'
  677.     216    236    256 tO  276 34  316 I^  336 PP  356 i^  376 pp
  678.     217    237    257 mac 277 ??  317 I"  337 ss  357 i"  377 y"
  679.  
  680.  
  681.  
  682. 1.2.12.3.  Decimal Latin-1
  683.  
  684.  
  685.     128    144    160 nsp 176 ++  192 A`  208 DD  224 a`  240 dd
  686.     129    145    161 !!  177 +-  193 A'  209 N~  225 a'  241 n~
  687.     130    146    162 c|  178 22  194 A^  210 O`  226 a^  242 o`
  688.     131    147    163 ##  179 33  195 A~  211 O'  227 a~  243 o'
  689.     132    148    164 cur 180   196 A"  212 O^  228 a"  244 o^
  690.     133    149    165 y-  181 uu  197 A+  213 O~  229 a+  245 o~
  691.     134    150    166 ||  182 pil 198 AE  214 O"  230 ae  246 o"
  692.     135    151    167 $$  183 ..  199 C,  215 xx  231 c,  247 //
  693.     136    152    168 ""  184 ,,  200 E`  216 O/  232 e`  248 o/
  694.     137    153    169 cO  185 11  201 E'  217 U`  233 e'  249 u`
  695.     138    154    170 a-  186 o-  202 E^  218 U'  234 e^  250 u'
  696.     139    155    171 <<  187 >>  203 E"  219 U^  235 e"  251 u^
  697.  
  698.  
  699.  
  700.  
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707. 12                                   recode reference manual
  708.  
  709.  
  710.     140    156    172 -.  188 14  204 I`  220 U"  236 i`  252 u"
  711.     141    157    173 --  189 12  205 I'  221 Y'  237 i'  253 y'
  712.     142    158    174 tO  190 34  206 I^  222 PP  238 i^  254 pp
  713.     143    159    175 mac 191 ??  207 I"  223 ss  239 i"  255 y"
  714.  
  715.  
  716.  
  717. 1.2.12.4.  Hexadecimal Latin-1
  718.  
  719.  
  720.      80    90    a0 nsp  b0 ++  c0 A`  d0 DD  e0 a`  f0 dd
  721.      81    91    a1 !!   b1 +-  c1 A'  d1 N~  e1 a'  f1 n~
  722.      82    92    a2 c|   b2 22  c2 A^  d2 O`  e2 a^  f2 o`
  723.      83    93    a3 ##   b3 33  c3 A~  d3 O'  e3 a~  f3 o'
  724.      84    94    a4 cur  b4   c4 A"  d4 O^  e4 a"  f4 o^
  725.      85    95    a5 y-   b5 uu  c5 A+  d5 O~  e5 a+  f5 o~
  726.      86    96    a6 ||   b6 pil c6 AE  d6 O"  e6 ae  f6 o"
  727.      87    97    a7 $$   b7 ..  c7 C,  d7 xx  e7 c,  f7 //
  728.      88    98    a8 ""   b8 ,,  c8 E`  d8 O/  e8 e`  f8 o/
  729.      89    99    a9 cO   b9 11  c9 E'  d9 U`  e9 e'  f9 u`
  730.      8a    9a    aa a-   ba o-  ca E^  da U'  ea e^  fa u'
  731.      8b    9b    ab <<   bb >>  cb E"  db U^  eb e"  fb u^
  732.      8c    9c    ac -.   bc 14  cc I`  dc U"  ec i`  fc u"
  733.      8d    9d    ad --   bd 12  cd I'  dd Y'  ed i'  fd y'
  734.      8e    9e    ae tO   be 34  ce I^  de PP  ee i^  fe pp
  735.      8f    9f    af mac  bf ??  cf I"  df ss  ef i"  ff y"
  736.  
  737.  
  738.  
  739. 1.2.13.  ASCII with easy French conventions
  740.  
  741.      This charset is identical to  ascii,  save  for  French
  742. diacritics  which  are noted using a slightly different con-
  743. vention.
  744.  
  745.      See See section Easy French for more details.
  746.  
  747. 1.3.  Easy French conventions
  748.  
  749.      These  conventions  are  used  in  texte  and   latexte
  750. charsets,  which  are seven bits codes.  At text entry time,
  751. these conventions provide a little speed up.  At read  time,
  752. they  slightly improve the readability.  Of course, it would
  753. better to have a specialized keyboard to make  direct  eight
  754. bits  entries and fonts for immediately displaying eight bit
  755. ISO Latin-1 characters.  But not everybody is so  fortunate.
  756. In several mailing environment, the eight bit is often will-
  757. fully destroyed (an horrible Crime that most people  do  not
  758. care to straighten up).
  759.  
  760.      See:
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773. recode reference manual                                   13
  774.  
  775.  
  776. 1.3.1.  French quotes
  777.  
  778.      French  quotes  (sometimes called ``angle quotes'') are
  779. noted the same way English quotes are noted in TeX,  id  est
  780. by `` and ''.
  781.  
  782. 1.3.2.  Latin ligatures
  783.  
  784.      No effort has been put to preserve Latin ligatures (ae,
  785. oe) which are representable in several other charsets.   So,
  786. these ligatures may be lost through Easy French conventions.
  787.  
  788. 1.3.3.  Diacritics
  789.  
  790.      This is almost the  French  convention  for  simplified
  791. diacritics entry:
  792.  
  793.      e'   Acute accent
  794.  
  795.      e`   Grave accent
  796.  
  797.      e^   Circumflex accent
  798.  
  799.      e"   Diaeresis
  800.  
  801.      c,   Cedilla
  802.  
  803.  
  804.      In  some  countries,  :  is  used  instead of " to mark
  805. diaeresis.  `recode' support  one  convention  on  a  single
  806. call, depending on the -c option of the recode command.
  807.  
  808.      The convention is prone to loosing information, because
  809. the diacritic meaning overloads some characters that already
  810. have  other  uses.  To alleviate this, some knowledge of the
  811. French language is insufflated  into  the  recognition  rou-
  812. tines.   So,  the  following  subtleties  are systematically
  813. obeyed by the various recognizers.
  814.  
  815.      o    A single quote which follows a e does  not  neces-
  816.           sarily  means an acute accent if it is followed by
  817.           a single other one.  For example:
  818.  
  819.           e'   will give an e with an acute accent.
  820.  
  821.           e''  will give a simple e, with a  closing  quota-
  822.                tion mark.
  823.  
  824.           e'''
  825.                will give an e with an acute accent, followed
  826.                by a closing quotation mark.
  827.  
  828.  
  829.  
  830.  
  831.  
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839. 14                                   recode reference manual
  840.  
  841.  
  842.           There is a problem induced by this  convention  if
  843.           there  are  English  citations with a French text.
  844.           In sentences like:
  845.  
  846.               There's a meeting at Archie's  restaurant.
  847.  
  848.  
  849.           the  single  quotes will be mistaken twice for
  850.           acute accents.  So  English  contractions  and
  851.           suffix possessives could be mangled.
  852.  
  853.      o    A  double  quote  or  colon,  depending  on -c
  854.           option, which follows a vowel  is  interpreted
  855.           as  diaeresis only if it is followd by another
  856.           letter.  But there are in French several words
  857.           that  end  with  a diaeresis, the program also
  858.           recognizes them.
  859.  
  860.           See See section Ending diaeresis for  a  study
  861.           of all the problematic cases.
  862.  
  863.      o    A  comma which follows a c is interpreted as a
  864.           cedilla only if it is followd by  one  of  the
  865.           vowels a, o and u.
  866.  
  867. 1.3.4.  List of words ending with diaeresis
  868.  
  869.      Here is a classification of all cases of a diaeresis at
  870. the end of a French word:
  871.  
  872.      o    Words ending in ``igue''
  873.  
  874.           -    Feminine words without a relative masculine:
  875.  
  876.  
  877.                    besaigue" cigue"
  878.  
  879.  
  880.  
  881.           -    Feminine words with a relative masculine:
  882.                (1)
  883.  
  884.  
  885.                    aigue" ambigue" contigue" exigue" subaigue" suraigue"
  886.  
  887.  
  888.  
  889.      o    Words not ending in ``igue''
  890.  
  891.           -    Ended by ``i'': (2)
  892.  
  893.  
  894.                    ai" congai" goi" hai"kai" inoui" sai" samurai" thai" tokai"
  895.  
  896.  
  897.  
  898.  
  899.  
  900.  
  901.  
  902.  
  903.  
  904.  
  905. recode reference manual                                   15
  906.  
  907.  
  908.  
  909.  
  910.           -    Ended by ``e'':
  911.  
  912.  
  913.                    canoe"
  914.  
  915.  
  916.  
  917.           -    Ended by ``u'': (3)
  918.  
  919.  
  920.                    Esau"
  921.  
  922.  
  923.  
  924.      Notes:
  925.  
  926.      1.   There are supposed to be seven words in this case.
  927.           So, one is missing.
  928.  
  929.      2.   Look at the following sentence:
  930.  
  931.               "Ai"e!  Voici le proble`me que j'ai"
  932.  
  933.  
  934.           or, using the -c option:
  935.  
  936.               Ai:e!  Voici le proble`me que j'ai:
  937.  
  938.  
  939.           There is an  ambiguity  between  an  ai",  the
  940.           small  animal,  and  the  indicative future of
  941.           avoir (first person singular),  when  followed
  942.           by what could be a diaeresis mark.  Hopefully,
  943.           the  case  is  solved  by  the  fact  that  an
  944.           apostrophe always precedes the verb and almost
  945.           never the animal.
  946.  
  947.      3.   I did not pay attention to proper  nouns,  but
  948.           this one showed up as being fairly evident.
  949.  
  950.      Just  to  complete  this  topic,  note that it would be
  951. wrong to make a rule for all words  ending  in  ``igue''  as
  952. needing a diaerisis.  Here are counter-examples:
  953.  
  954.  
  955.     becfigue be`sigue bigue bordigue bourdigue brigue contre-digue
  956.     digue d'intrigue fatigue figue garrigue gigue igue intrigue
  957.     ligue prodigue sarigue zigue
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971. 16                                   recode reference manual
  972.  
  973.  
  974. 1.3.5.  When, How and Who.
  975.  
  976.      Easy  French  has  been  in  use in France for a while.
  977. Loic Dachary <loic@design.axis.fr> first exposed me to  this
  978. particular  convention.   I  only  slightly  adapted it (the
  979. diaeresis option) to make it  more  comfortable  to  several
  980. usages in Que'bec originating from Universite' de Montre'al.
  981.  
  982.      In fact, the main problem for me was not to necessarily
  983. to invent Easy French, but to recognize the ``best'' conven-
  984. tion to use, (best is not being defined, here) and to try to
  985. solve  the  main pithfalls associated with the selected con-
  986. vention.   I'm  particularily  grateful  to  Claude  Goutier
  987. <6@cc.umontreal.ca>  whom,  through  numerous discussions in
  988. August 1988, was quite helpful in evaluating various hypoth-
  989. esis.
  990.  
  991. 1.4.  Internal aspects
  992.  
  993.      This information is organized in:
  994.  
  995. 1.4.1.  Overall organization
  996.  
  997.      The  main driver has a table giving the conversion rou-
  998. tines available and for each, the starting charset  and  the
  999. ending  charset.   It  then tries to figure out the shortest
  1000. sequence  of  conversions  that  will  transform  the  input
  1001. charset  into  the  final  charset.   Let  us consider these
  1002. charsets as being the nodes of a directed  graph.   `recode'
  1003. has  internally  a  few  elementary recoding methods, called
  1004. single-steps, each of which may be  considered  as  oriented
  1005. arc  from  one  node  to the other.  A cost is attributed to
  1006. each single-step.  Given a starting code and  a  goal  code,
  1007. `recode' computes the most economical route through the ele-
  1008. mentary recodings.
  1009.  
  1010.      The main part of `recode' is written in C, as are  most
  1011. single-steps.   A  few  single-steps which need to recognize
  1012. sequences of multiple characters are written in `lex'.
  1013.  
  1014. 1.4.2.  Internal vs external piping
  1015.  
  1016.      Suppose that four elementary steps are selected at path
  1017. optimization  time.   Then  `recode'  will split itself into
  1018. four different tasks interconnected  with  pipes,  logically
  1019. equivalent to:
  1020.  
  1021.  
  1022.     step1 <input | step2 | step3 | step4 >output
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037. recode reference manual                                   17
  1038.  
  1039.  
  1040. 1.4.3.  Some limitations
  1041.  
  1042.      Here are some limitations of the program.
  1043.  
  1044.      o    There  is  a limit (currently 10) on the number of
  1045.           steps allowed in one single  recodification  work.
  1046.           It should stay sufficient for quite a while, maybe
  1047.           for ever.  This is a simple  compilation  #define,
  1048.           in any case.
  1049.  
  1050. 1.4.4.  Adding new charsets
  1051.  
  1052.      It is fairly easy for a programmer to add a new charset
  1053. to `recode'.  All it requires is making two routines,  modi-
  1054. fying a few tables, and makeing `recode' again.
  1055.  
  1056.      One  of  the  routine  should convert from any previous
  1057. charset to the new one.  Any previous charset will  do,  but
  1058. try  to select it so you will not loose too much information
  1059. while converting.  If you have to read multiple bytes of the
  1060. old charset before recognizing the character to produce, you
  1061. might write this routine in `lex'; otherwize, use C.  Proto-
  1062. type  your  routine  after  one of those which exists, so to
  1063. keep the sources uniform.
  1064.  
  1065.      The other routine should convert from the  new  charset
  1066. to  any  older  one.  You do not have to select the same old
  1067. charset than what you selected  for  the  previous  routine.
  1068. Select  any  charset  for  which you will not loose too much
  1069. information while converting.  If the routine  has  to  read
  1070. multiple  bytes  of  the  new  charset before deciding which
  1071. character it will produce, you might write this  routine  in
  1072. `lex';  otherwize,  use C.  Prototype your routine after one
  1073. of those which exists, so to keep the sources uniform.
  1074.  
  1075.      Edit `Makefile' to add the object name of your two rou-
  1076. tines  to the C_STEPS or L_STEPS macro definition, depending
  1077. on the fact your routines is written in C or in `lex'.  Then
  1078. edit `steps.h' in the four following places:
  1079.  
  1080.      1.   Create  a  symbol  for  your  new  charset in enum
  1081.           TYPE_code definition.
  1082.  
  1083.      2.   Add  the  option  name  of  your  new  charset  in
  1084.           code_keywords initialization.
  1085.  
  1086.      3.   Add  two  extern declarations for your routines at
  1087.           the appropriate places.
  1088.  
  1089.      4.   Add two lines in single_steps array initialization
  1090.           to  declare your routines.  For each line, include
  1091.           the four following fields:
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103. 18                                   recode reference manual
  1104.  
  1105.  
  1106.           1.   The function name of your routine.
  1107.  
  1108.           2.   The starting code enum constant, that is, the
  1109.                code your routine reads.
  1110.  
  1111.           3.   The  goal  code  enum  constant, that is, the
  1112.                code your routine produces.
  1113.  
  1114.           4.   The  cost  of   your   routine,   using   the
  1115.                predefined constants STEP, LOOSE, EXACT, SLOW
  1116.                and FAST.  See the  comments  for  the  exact
  1117.                meaning  of  each  of  these  and  follow the
  1118.                examples.   Respect  these  meanings  and  be
  1119.                honest with the costs!
  1120.  
  1121.  
  1122.           In  some circumstances, one of your routines would
  1123.           be a mere copy.  It is better in this case to  not
  1124.           provide  the  routine,  but  still  declare  it in
  1125.           single_steps using NULL as its function  name  and
  1126.           ALREADY alone as its cost.
  1127.  
  1128.  
  1129. 1.5.  Future things
  1130.  
  1131.      I  will  be  glad to hear critics and suggestions, even
  1132. for details.   This  program  is  made  up  of  hundreds  of
  1133. details, in fact.  Write to pinard@iro.umontreal.ca.
  1134.  
  1135.      Some notes and suggestions.
  1136.  
  1137.      o    Accept  abbreviations  for charsets on the command
  1138.           call.   Accept  more  than  one  conversion   with
  1139.           intermediate filters in a single call.
  1140.  
  1141.      o    Support    Universite   de   Montreal   ``accent''
  1142.           convention.
  1143.  
  1144.      o    Support [nt]roff diacritics.
  1145.  
  1146.      o    Support the Atari-ST internal code.
  1147.  
  1148.      o    Segregate charsets and usages.
  1149.  
  1150.      o    Is there some way of specifying that recode should
  1151.           not  contract something that looks like an accent?
  1152.           Like "There\'s a meeting at Archie\'s restaurant"?
  1153.           (With  corresponding  insertion  of backslashes or
  1154.           whatevers when converting the other way, of course
  1155.           - the transformation from accented to ascii should
  1156.           be exactly invertable in all cases.)   Of  course,
  1157.           There\'s will not be contracted.
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169. recode reference manual                                   19
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.